﻿using FubiManger.UI;
using Smobiler.Core;
using Smobiler.Core.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FubiManger.UI;

namespace FubiManger.Controls
{
    ////ToolboxItem用于控制是否添加自定义控件到工具箱，true添加，false不添加
    //[System.ComponentModel.ToolboxItem(true)]
    partial class businessmenucontrol : Smobiler.Core.Controls.MobileUserControl
    {
        public businessmenucontrol() : base()
        {
            //This call is required by the SmobilerUserControl.
            InitializeComponent();
        }
        /// <summary>
        /// 菜单名称
        /// </summary>
        public string businname { get; set; }

        public string imgnmae { get; set; }
        /// <summary>
        /// 商品分类ID
        /// </summary>
        public string clsid { get; set; }
        /// <summary>
        /// 1预览2下单3加单
        /// </summary>
        public string stype { get; set; }
        private void btnvalue_Press(object sender, EventArgs e)
        {

            if (stype == "1")//预览
            {
                ((BusinessForm)this.Form).RemoveAllImgStyle();
                ((BusinessForm)this.Form).ChangeImgStyle(imgmenu);
                ((BusinessForm)this.Form).Show_name(btnvalue.Text, clsid);

            }
            else if (stype == "2")//下单
            {
                ((OrderfoodForm)this.Form).RemoveAllImgStyle();
                ((OrderfoodForm)this.Form).ChangeImgStyle(imgmenu);
                ((OrderfoodForm)this.Form).Show_name(btnvalue.Text, clsid);
            }
            else
            {
                ((AddfoodForm)this.Form).RemoveAllImgStyle();
                ((AddfoodForm)this.Form).ChangeImgStyle(imgmenu);
                ((AddfoodForm)this.Form).Show_name(btnvalue.Text, clsid);
            }
            btnvalue.ForeColor = System.Drawing.Color.White;
        }

        private void businessmenucontrol_Load(object sender, EventArgs e)
        {
            btnvalue.Text = businname;
            imgmenu.ResourceID = imgnmae;//图片名称
        }
    }
}